package com.six.work.servicesImpl;

//import com.github.pagehelper.Page;
//import com.github.pagehelper.page.PageMethod;
import com.six.work.entity.Applicant;
import com.six.work.entity.Company;
import com.six.work.entity.Swords;
import com.six.work.mapper.ApplicantMapper;
import com.six.work.services.ApplicantServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import java.util.Date;
import java.util.List;
@Service
public class ApplicantServicesImpl implements ApplicantServices {
    @Autowired
    private ApplicantMapper applicantMapper;

    //原始列表
    @Override
    public List<Applicant> findAllApplicant() {
        List<Applicant> list = applicantMapper.findAllApplicant();
        return list;
    }


    //根据求职者名字查询
    @Override
    public List<Applicant> findAppByAppName(String applicant_name){
        List<Applicant> list = applicantMapper.findAppByAppName(applicant_name);
        return list;
    }

    //根据名字和状态查询
    @Override
    public List<Applicant> findAppByStateAndAppName(String applicant_name,Integer state_id){
        List<Applicant> list = applicantMapper.findAppByStateAndAppName(applicant_name,state_id);
        return list;
    }


    //求职者发布管理原始列表
    @Override
    public List<Applicant> findAllApplicantJob() {
        return applicantMapper.findAllApplicantJob();
    }

    //求职者发布管理查询,分页功能已完成
    @Override
    public PageInfo<Applicant> findAppJobByName(String appName,Integer num) {
        PageHelper.startPage(num,7);
        List<Applicant> list=applicantMapper.findAppJobByName(appName);
        PageInfo<Applicant> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }

    //求职者信息管理删除功能
    @Override
    public Integer DelAppByID(Integer applicant_id) {
        return applicantMapper.DelAppByID(applicant_id);
    }

    //求职者信息管理查询功能
    @Override
    public PageInfo<Applicant> findAppByName(String appName,Integer num) {
        PageHelper.startPage(num,7);
        List<Applicant> list=applicantMapper.findAppByName(appName);
        PageInfo<Applicant> pageInfo= new PageInfo<>(list);
        return pageInfo;
    }

    //求职者发布管理驳回功能
    @Override
    public String updateAppState(Integer applicant_id) {
        return applicantMapper.updateAppState(applicant_id);
    }

    //求职者发布管理通过功能
    @Override
    public String updateAppState1(Integer applicant_id) {
        return applicantMapper.updateAppState1(applicant_id);
    }

    //登录功能
    @Override
    public Applicant UserLogin(String applicant_number) {
        return applicantMapper.UserLogin(applicant_number);
    }

    //注册功能
    @Override
    public Integer insertApp(Applicant applicant) {
        return applicantMapper.insertApp(applicant);
    }

    @Override
    public Integer updateApplicant(Applicant applicant) {
        return applicantMapper.updateApplicant(applicant);
    }

    @Override
    public Integer updateApp(Applicant applicant) {
        return applicantMapper.updateApp(applicant);
    }

    @Override
    public Applicant SelectAppByID(Integer applicant_id) {
        return applicantMapper.SelectAppByID(applicant_id);
    }

    //可视化
    @Override
    public List<Applicant> findAllApp() {
        List<Applicant> list = applicantMapper.findAllApp();
        return list;
    }

    //今日新增
    @Override
    public Integer FindTodayCom() {
        return applicantMapper.FindTodayCom();
    }

    @Override
    public Integer FindMonthCom() {
        return applicantMapper.FindMonthCom();
    }
   }
